<extend name="Layout/ins_page" />
<block name="content">
	{:W('PageHeader/simple',array('name'=>'基本资料'))}
	<div class="sub-frame gray">
		<form id="form_data" name="form_data" method="post" >
			<input type="hidden" id="save_name" name="save_name">
			<input type="hidden" name="id" id="id" value="{$vo.id}">
			<input type="hidden" name="signature" id="signature" >
			<input type="hidden" name="opmode" id="opmode" value="edit">
			<div>
				<div>
					<div class="layui-sub-form-item">
						<div class="layui-input-block">
							<img id="pic" class="avtar" src="{$vo.pic}">
							<a id="btn_select_avatar" class="btn">修改头像</a>
						</div>
					</div>
					<hr style="clear: none">
					<div class="layui-sub-form-item">
						<label class="layui-form-label">员工编号*：</label>
						<div class="layui-input-block col-16">
							<input class="layui-input" type="text" id="emp_no" name="emp_no"  check="required" info="请输入员工编号" readonly="readonly" value="{$vo.emp_no}">
						</div>
					</div>
					<div class="layui-sub-form-item">
						<label class="layui-form-label">姓名*：</label>
						<div class="layui-input-block col-16">
							<input class="layui-input" type="text" id="name" name="name"  check="required" info="请输入姓名" value="{$vo.name}" >
						</div>
					</div>
					<div class="layui-sub-form-item">
						<label class="layui-form-label">性别*：</label>
						<div class="layui-input-block col-10">
							<select name="sex" id="sex" class="layui-input ">
								<option  value="male">男</option>
								<option value="female">女</option>
							</select>
						</div>
					</div>
					<div class="layui-sub-form-item">
						<label class="layui-form-label">生日*：</label>
						<div class="layui-input-block">
							<input  type="text" id="birthday" name="birthday"  class="input-date layui-input" value="{$vo.birthday}" >
						</div>
					</div>
					<div class="layui-sub-form-item">
						<label class="layui-form-label">部门*：</label>
						<div class="layui-input-block">
							<div class="layui-input-static">
								{$vo.dept_name}
							</div>
						</div>
					</div>
					<div class="layui-sub-form-item">
						<label class="layui-form-label">职位*：</label>
						<div class="layui-input-block  col-19">
							<div class="layui-input-static">
								{$vo.position_name}
							</div>
						</div>
					</div>
					<div class="layui-sub-form-item">
						<label class="layui-form-label">办公室电话*：</label>
						<div class="layui-input-block col-19">
							<input type="text" id="office_tel" name="office_tel" class="layui-input" value="{$vo.office_tel}">
						</div>
					</div>
					<div class="layui-sub-form-item">
						<label class="layui-form-label">移动电话*：</label>
						<div class="layui-input-block col-19">
							<input type="text" id="mobile_tel" name="mobile_tel" class="layui-input" value="{$vo.mobile_tel}">
						</div>
					</div>
					<div class="layui-sub-form-item">
						<label class="layui-form-label">电子邮箱*：</label>
						<div class="layui-input-block">
							<input type="text" id="email" name="email" class="layui-input" value="{$vo.email}">
						</div>
					</div>
					<div class="layui-sub-form-item">
						<label class="layui-form-label">负责业务*：</label>
						<div class="layui-input-block">
							<input type="text" id="duty" name="duty" class="layui-input" value="{$vo.duty}">
						</div>
					</div>
					<div class="layui-sub-form-item">
						<div class="layui-input-block">
							<a id="btn_save"  class="btn">保存</a>
						</div>
					</div>
				</div>
			</div>
		</form>
	</div>
</block>
<block name="js">
	<script type="text/javascript">
		layui.use(['global'], function() {
			var $ = layui.jquery;
			

			set_return_url(null);
			set_val('sex', '{$vo.sex}');

			$("#btn_save").on('click', function() {
				send_form("form_data", "{:U('save')}", "{:U('index')}", function(ret) {
					if (ret.status) {
						layer.msg(ret.info);
						location.reload(true);
					} else {
						layer.msg(ret.info);
						return false;
					}
				});
			});

			$('#btn_select_avatar').on('click', function() {
				if ($("#id").val().length == 0) {
					layer.msg("请选择用户");
					return false;
				}
				winopen("{:U('popup/avatar')}?id={$vo.id}", 560, 470);
			});

		});
	</script>

</block>